package com.pur.zsms.matermanage.mater.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.pur.zsms.common.dao.GenericDao;
import com.pur.zsms.common.dao.JpaTemplate;
import com.pur.zsms.common.exception.GenericException;
import com.pur.zsms.matermanage.mater.dao.IMaterUnitDao;
import com.pur.zsms.matermanage.mater.po.UnitMaterConvertPo;

@Repository("materUnitDao")
@Transactional
public class materUnitDaoImpl extends GenericDao implements IMaterUnitDao {

	public List<UnitMaterConvertPo> getUnitMaterConvertPoByAuxiliaryMaterId(int auxiliaryMaterId, int supId) throws GenericException {
		JpaTemplate template = this.getTemplate();
		StringBuffer ql = new StringBuffer();
		ql.append(" select o ");
		ql.append(" from UnitMaterConvertPo o where o.auxiliaryMaterId='" + auxiliaryMaterId + "' and o.supId ='" + supId + "'");
		List<UnitMaterConvertPo> list = template.find(ql.toString(), null);
		return list;
	}

}
